package cn.edu.sdjzu.xg.kcsj.security;

import java.io.Serializable;
import java.util.List;

public class Resource implements Comparable<Resource>, Serializable {
    private int id;
    private String description;
    private String no;
    private String router;
    private Resource parent;
    private List<Integer> parent_ids;
    private boolean haveChild;
    private boolean available;
    private int type;


    public Resource() {
    }

    public Resource(int id, String description, String no, String router, Resource parent, List<Integer> parent_ids, boolean haveChild, boolean available, int type) {
        this.id = id;
        this.description = description;
        this.no = no;
        this.router = router;
        this.parent = parent;
        this.parent_ids = parent_ids;
        this.haveChild = haveChild;
        this.available = available;
        this.type = type;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getRouter() {
        return router;
    }

    public void setRouter(String router) {
        this.router = router;
    }

    public Resource getParent() {
        return parent;
    }

    public void setParent(Resource parent) {
        this.parent = parent;
    }

    public List<Integer> getParent_ids() {
        return parent_ids;
    }

    public void setParent_ids(List<Integer> parent_ids) {
        this.parent_ids = parent_ids;
    }

    public boolean isHaveChild() {
        return haveChild;
    }

    public void setHaveChild(boolean haveChild) {
        this.haveChild = haveChild;
    }

    public boolean isAvailable() {
        return available;
    }

    public void setAvailable(boolean available) {
        this.available = available;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Override
    public int compareTo(Resource o) {
        return this.id -  o.id;
    }
}
